package factory;

import data.course;
import data.teacher;
import dataBase.courseBaseConnector;
import dataBase.userBaseConnector;
import PO.SelectPO;

public class selectFactory {

	public SelectPO selectPOMaker(String[] info){
		CourseFactory cf = new CourseFactory();
		userBaseConnector ubc = new userBaseConnector();
		courseBaseConnector cbc = new courseBaseConnector();
		course c = cf.courseMaker(cbc.queryCourse(info[0]));
		String[] t = ubc.queryTeacherInfo(c.getID());
		SelectPO s = new SelectPO(info[0],info[1],c.getTeacher(),info[2],info[3]);
		int score = info[4] == null ?-1:Integer.valueOf(info[4]);
		s.setScore(score);
		return s;
	}
}
